import React, { useState, useEffect } from 'react';
import { EditorProvider, FloatingMenu, BubbleMenu } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import { proccessNames } from '../../services/pdProcess/pdProcess';
const sampleData = 
    {
      none:{name:'none',dictName:'none',columns:[],joined:'none'},
      process:{name:'Процесс',dictName:'process',
    columns:proccessNames,
  joined:'employee'}, 
    AWP:{name:'АРМ',dictName:'AWP',
    columns:[{name:"Имя",dictName:"name",type:"text"},{name:"Локация",dictName:"location",type:"text"},
    {name:"Тип",dictName:"type",type:"text"},{name:"Подразделение",dictName:"subdivision",type:"text"},{name:"ИСПДн",dictName:"ispdns",type:"text"}]
    ,joined:'ISPDN'
    }, employee:{name:'Сотрудник',dictName:'employee',
    columns:[{name:"Почта",dictName:"email",type:"text"},{name:"подразделение",dictName:"subdivision",type:"text"},
    {name:"Должность",dictName:"job",type:"text"},
    {name:"Имя",dictName:"name",type:"text"},
    {name:"Фамилия",dictName:"secondName",type:"text"},
    {name:"Отчество",dictName:"fatherName",type:"text"},
    {name:"АРМ",dictName:"awp",type:"text"}
    ],
    joined:'AWP'
    },ISPDN:{name:'ИСПДн',dictName:"ISPDN",
    columns:[{name:"Имя",dictName:"name",type:"text"},{name:"Уровень защиты",dictName:"defenceLevel",type:"text"},
    {name:"Трансграничная передеча",dictName:"overBorder",type:"checkbox"},{name:"Местоположение",dictName:"location",type:"text"}]
    ,joined:'none'}};

    
    // define your extension array
    const extensions = [
      StarterKit,
    ]
    
    const content = '<p>Hello World!</p>'
    
    const Tiptap = () => {
      return (
        <EditorProvider extensions={extensions} content={content}>
          <FloatingMenu>This is the floating menu</FloatingMenu>
          <BubbleMenu>This is the bubble menu</BubbleMenu>
        </EditorProvider>
      )
    }
    
    export default Tiptap